home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Gfx
/
Edit
/
TSMorph
/
src
/
ControlWindow.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-06
|
20KB
|
654 lines
// TSMorph - Amiga Morphing program
// Copyright (C) © 1993 Topicsave Limited
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// mpaddock@cix.compulink.co.uk
// Include precompiled headers if not already included
#ifndef TSMORPH_H
#include "TSMorph.h"
#endif
/* Gadgets in the control window */
extern struct ExtGadget OneGadget = {
&TwoGadget,
0,0,
IMAGE_WIDTH,IMAGE_HEIGHT,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_IMMEDIATE,
GTYP_BOOLGADGET,
&One_im,
&One_imx,
NULL,
0,
NULL,
ONEGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget TwoGadget = {
&RelGadget,
0,0,
IMAGE_WIDTH,IMAGE_HEIGHT,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_IMMEDIATE,
GTYP_BOOLGADGET,
&Two_im,
&Two_imx,
NULL,
0,
NULL,
TWOGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget RelGadget = {
&MyAddGadget,
0,0,
IMAGE_WIDTH,IMAGE_HEIGHT,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_IMMEDIATE,
GTYP_BOOLGADGET,
&Rel_im,
&Rel_imx,
NULL,
0,
NULL,
RELGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget MyAddGadget = { // Note not AddGadget as this is a function!
&DelGadget,
0,0,
IMAGE_WIDTH,IMAGE_HEIGHT,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_IMMEDIATE,
GTYP_BOOLGADGET,
&Add_im,
&Add_imx,
NULL,
0,
NULL,
ADDGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget DelGadget = {
&LinkGadget,
0,0,
IMAGE_WIDTH,IMAGE_HEIGHT,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_IMMEDIATE,
GTYP_BOOLGADGET,
&Del_im,
&Del_imx,
NULL,
0,
NULL,
DELGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget LinkGadget = {
&UnlinkGadget,
0,0,
IMAGE_WIDTH,IMAGE_HEIGHT,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_IMMEDIATE,
GTYP_BOOLGADGET,
&Link_im,
&Link_imx,
NULL,
0,
NULL,
LINKGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget UnlinkGadget = {
&NoneGadget,
0,0,
IMAGE_WIDTH,IMAGE_HEIGHT,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_IMMEDIATE,
GTYP_BOOLGADGET,
&Unlink_im,
&Unlink_imx,
NULL,
0,
NULL,
UNLINKGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget NoneGadget = {
&stGadget,
0,0,
IMAGE_WIDTH,IMAGE_HEIGHT,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_SELECTED|GFLG_EXTENDED,
GACT_IMMEDIATE,
GTYP_BOOLGADGET,
&None_im,
&None_imx,
NULL,
0,
NULL,
NONEGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget stGadget = {
&prevGadget,
0,0,
AIMAGE,AIMAGE,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_RELVERIFY,
GTYP_BOOLGADGET,
&st_im,
&st_imx,
NULL,
0,
NULL,
STGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget prevGadget = {
&gotoGadget,
0,0,
AIMAGE,AIMAGE,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_RELVERIFY,
GTYP_BOOLGADGET,
&prev_im,
&prev_imx,
NULL,
0,
NULL,
PREVGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget gotoGadget = {
&nextGadget,
0,0,
AIMAGE+1,AIMAGE,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_RELVERIFY,
GTYP_BOOLGADGET,
&goto_im,
&goto_imx,
NULL,
0,
NULL,
GOTOGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget nextGadget = {
&lastGadget,
0,0,
AIMAGE,AIMAGE,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_RELVERIFY,
GTYP_BOOLGADGET,
&next_im,
&next_imx,
NULL,
0,
NULL,
NEXTGADGET,
NULL,
GMORE_GADGETHELP
};
extern struct ExtGadget lastGadget = {
NULL,
0,0,
AIMAGE,AIMAGE,
GFLG_GADGHIMAGE|GFLG_GADGIMAGE|GFLG_EXTENDED,
GACT_RELVERIFY,
GTYP_BOOLGADGET,
&last_im,
&last_imx,
NULL,
0,
NULL,
LASTGADGET,
NULL,
GMORE_GADGETHELP
};
/* Menu for the Control Window - comments on the right are the array index */
extern struct NewMenu MyNewMenu[] = { // There must be an easier way!
{ NM_TITLE, NULL,NULL,0,0,NULL }, // 0
{ NM_ITEM,NULL,NULL,0,0,0 }, // 1
{ NM_ITEM,NULL,NULL,0,0,0 }, // 2
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 3
{ NM_ITEM,NULL,NULL,0,0,0}, // 4
{ NM_ITEM,NULL,NULL,0,0,0}, // 5
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 6
{ NM_ITEM,NULL,NULL,0,0,0 }, // 7
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 8
{ NM_ITEM,NULL,NULL,0,0,0 }, // 9
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 10
{ NM_ITEM,NULL,NULL,0,0,0 }, // 11
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 12
{ NM_ITEM,NULL,NULL,0,0,NULL }, // 13
{ NM_TITLE, NULL,0,0,0,NULL}, // 14
{ NM_ITEM,NULL,NULL,0,0,0 }, // 15
{ NM_ITEM,NULL,NULL,0,0,0 }, // 16
{ NM_ITEM,NULL,NULL,0,0,NULL }, // 17
{ NM_SUB,NULL,NULL,0,0,0 }, // 18
{ NM_SUB,NULL,NULL,0,0,0 }, // 19
{ NM_SUB,NULL,NULL,0,0,0 }, // 20
{ NM_SUB,NULL,NULL,0,0,0 }, // 21
{ NM_SUB,NULL,NULL,0,0,0 }, // 22
{ NM_ITEM,NULL,0,0,0,NULL }, // 23
{ NM_SUB, NULL,NULL,CHECKIT,~1,NULL }, // 24
{ NM_SUB, NULL,NULL,CHECKIT,~2,NULL }, // 25
{ NM_SUB, NULL,NULL,CHECKIT,~4,NULL }, // 26
{ NM_SUB, NULL, NULL,CHECKIT,~8,NULL }, // 27
{ NM_SUB, NULL, NULL,CHECKIT,~16,NULL }, // 28
{ NM_SUB, NULL, NULL,CHECKIT,~32,NULL }, // 29
{ NM_SUB, NULL, NULL,CHECKIT,~64,NULL }, // 30
{ NM_SUB, NULL, NULL,CHECKIT|CHECKED,~128,NULL }, // 31
{ NM_TITLE, NULL,0,0,0,NULL }, // 32
{ NM_ITEM,NULL,NULL, CHECKIT|MENUTOGGLE,0,NULL }, // 33
{ NM_ITEM,NULL,NULL, CHECKIT|MENUTOGGLE,0,NULL }, // 34
{ NM_ITEM,NULL,NULL, CHECKIT|MENUTOGGLE,0,NULL }, // 35
{ NM_ITEM,NULL,NULL,0,NULL}, // 36
{ NM_SUB, NULL,NULL,CHECKIT,~1,NULL }, // 37
{ NM_SUB, NULL,NULL,CHECKIT,~2,NULL }, // 38
{ NM_SUB, NULL,NULL,CHECKIT,~4,NULL }, // 39
{ NM_SUB, NULL,NULL,CHECKIT,~8,NULL }, // 40
{ NM_SUB, NULL,NULL,CHECKIT,~16,NULL }, // 41
{ NM_ITEM,NULL,NULL,0,NULL}, // 42
{ NM_ITEM,NULL,NULL,0,NULL}, // 43
{ NM_ITEM,NULL,NULL,0,NULL}, // 44
{ NM_ITEM,NULL,NULL,0,NULL}, // 45
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 46
{ NM_ITEM,NULL,NULL,CHECKIT|MENUTOGGLE,NULL},// 47
{ NM_ITEM,NULL,NULL,CHECKIT|MENUTOGGLE,NULL}, // 48
{ NM_ITEM,NULL, NULL, 0, NULL }, // 49
{ NM_ITEM,NULL, NULL, 0, NULL }, // 50
{ NM_ITEM,NULL, NULL, 0, NULL }, // 51
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 52
{ NM_ITEM,NULL,NULL, CHECKIT|MENUTOGGLE,NULL },// 53
{ NM_ITEM,NULL,NULL,0,NULL}, // 54
{ NM_ITEM,NULL,NULL,0,NULL}, // 55
{ NM_ITEM,NULL,NULL,0,NULL}, // 56
{ NM_ITEM,NULL,NULL,0,NULL}, // 57
{ NM_ITEM,NULL,NULL,0,NULL}, // 58
{ NM_ITEM,NULL,NULL,0,NULL}, // 59
{ NM_ITEM,NULL,NULL,0,NULL}, // 60
{ NM_SUB, NULL,NULL,CHECKIT|MENUTOGGLE,NULL }, // 61
{ NM_SUB, NULL,NULL,CHECKIT|MENUTOGGLE,NULL }, // 62
{ NM_SUB, NULL,NULL,CHECKIT|MENUTOGGLE,NULL }, // 63
{ NM_SUB, NULL,NULL,CHECKIT|MENUTOGGLE,NULL },// 64
{ NM_SUB, NULL,NULL,CHECKIT|MENUTOGGLE,NULL },// 65
{ NM_ITEM,NULL, NULL, 0, NULL }, // 66
{ NM_SUB, NULL,NULL,CHECKIT,~1,NULL }, // 67
{ NM_SUB, NULL,NULL,CHECKIT,~2,NULL }, // 68
{ NM_SUB, NULL,NULL,CHECKIT,~4,NULL }, // 69
{ NM_SUB, NULL,NULL,CHECKIT,~8,NULL }, // 70
{ NM_SUB, NULL,NULL,CHECKIT,~16,NULL }, // 71
{ NM_SUB, NULL,NULL,CHECKIT,~32,NULL }, // 72
{ NM_SUB, NULL,NULL,CHECKIT,~64,NULL }, // 73
{ NM_SUB, NULL,NULL,CHECKIT,~128,NULL }, // 74
{ NM_SUB, NULL,NULL,CHECKIT,~256,NULL }, // 75
{ NM_SUB, NULL,NULL,CHECKIT,~512,NULL }, // 76
{ NM_SUB, NULL,NULL,CHECKIT,~1024,NULL }, // 77
{ NM_SUB, NULL,NULL,CHECKIT,~2048,NULL }, // 78
{ NM_SUB, NULL,NULL,CHECKIT,~4096,NULL }, // 79
{ NM_SUB, NULL,NULL,CHECKIT,~8192,NULL }, // 80
{ NM_ITEM,NULL, NULL, 0, NULL }, // 81
{ NM_ITEM,NULL, NULL, 0, NULL }, // 82
{ NM_ITEM,NULL,NULL,CHECKIT|MENUTOGGLE,NULL }, // 83
{ NM_ITEM,NULL,NULL,CHECKIT|MENUTOGGLE,NULL }, // 84
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 85
{ NM_ITEM,NULL,NULL,0,NULL }, // 86
{ NM_ITEM,NULL,NULL,0,NULL }, // 87
{ NM_ITEM,NULL,NULL,0,NULL }, // 88
{ NM_ITEM,NM_BARLABEL,NULL,0,0,NULL }, // 89
{ NM_ITEM,NULL,NULL,CHECKIT|MENUTOGGLE,NULL }, // 90
{ NM_END,NULL,NULL,0,0,NULL }
};
/* Screen and VisualInfo for ControlWindow */
static struct Screen *Screen = NULL;
static struct VisualInfo *VisInfo = NULL;
/* The Window and its menus and (animated) screen title */
extern struct Window *ControlWindow = NULL;
extern struct Menu *MyMenu = NULL;
extern UBYTE *CWTitle = " "; // note at least 3 spaces at end for frame number!
// "TSMorph - Frame "
/* Open the Control Window
* Not really sure why it returns a Struct Window *
* as ControlWindow is set up inside this function anyway
* should really be a BOOL
*/
struct Window *
OpenControlWindow(void) {
ULONG HNum; // The current edit mode is displayed as help
switch (Mode) {
case EDIT1:
HNum = H_EOne;
break;
case EDIT2:
HNum = H_ETwo;
break;
case EDITREL:
HNum = H_ERel;
break;
case ADD:
HNum = H_EAdd;
break;
case DELETE:
HNum = H_EDel;
break;
case LINK1:
HNum = H_ELnk;
break;
case UNLINK1:
HNum = H_EUnl;
break;
case NONE:
HNum = H_EMov;
break;
}
if (Screen = LockPubScreen(PubScreenName)) { /* Supplied in PUBSCREEN= */
// Dynamically position all the gadgets (actually only based on window top border)
/* Gadgets in the left column */
OneGadget.LeftEdge =
RelGadget.LeftEdge =
DelGadget.LeftEdge =
UnlinkGadget.LeftEdge =
stGadget.LeftEdge = Screen->WBorLeft;
/* Gadgets in the right column */
TwoGadget.LeftEdge =
MyAddGadget.LeftEdge =
LinkGadget.LeftEdge =
NoneGadget.LeftEdge = Screen->WBorLeft + IMAGE_WIDTH;
prevGadget.LeftEdge = Screen->WBorLeft + AIMAGE;
gotoGadget.LeftEdge = Screen->WBorLeft + (AIMAGE+AIMAGE);
nextGadget.LeftEdge = Screen->WBorLeft + (AIMAGE+AIMAGE+AIMAGE+1); // +1 as gotoGadget is 1 wider
lastGadget.LeftEdge = Screen->WBorLeft + (AIMAGE+AIMAGE+AIMAGE+1+AIMAGE);
/* Gadgets in top row */
OneGadget.TopEdge =
TwoGadget.TopEdge = Screen->WBorTop + Screen->Font->ta_YSize+1;
/* Gadgets in 2nd row */
RelGadget.TopEdge =
MyAddGadget.TopEdge = Screen->WBorTop + Screen->Font->ta_YSize+1+(IMAGE_HEIGHT);
/* Gadgets in 3rd row */
DelGadget.TopEdge =
LinkGadget.TopEdge = Screen->WBorTop + Screen->Font->ta_YSize+1+(IMAGE_HEIGHT+IMAGE_HEIGHT);
/* Gadgets in bottom (-1) row */
UnlinkGadget.TopEdge =
NoneGadget.TopEdge = Screen->WBorTop + Screen->Font->ta_YSize+1+(IMAGE_HEIGHT+IMAGE_HEIGHT+IMAGE_HEIGHT);
/* Arrow gadgets */
stGadget.TopEdge =
prevGadget.TopEdge =
gotoGadget.TopEdge =
nextGadget.TopEdge =
lastGadget.TopEdge = Screen->WBorTop + Screen->Font->ta_YSize+1+(IMAGE_HEIGHT+IMAGE_HEIGHT+IMAGE_HEIGHT+IMAGE_HEIGHT);
if ((SinglePicture == 2) || (SinglePicture == 3)) { // Animated so set screen title
sprintf(CWTitle,MyGetMsg(MSG_TSMFRAME),FrameNumber);
}
else {
strcpy(CWTitle,MyGetMsg(MSG_TSM)); // Otherwise default
}
/* Open the window, in a default position */
if (ControlWindow = OpenWindowTags(NULL,
WA_Gadgets, &OneGadget,
WA_IDCMP, IDCMP_MENUPICK | IDCMP_CLOSEWINDOW | IDCMP_MENUHELP |
IDCMP_GADGETDOWN | IDCMP_RAWKEY | IDCMP_VANILLAKEY | IDCMP_GADGETUP |
IDCMP_GADGETHELP | IDCMP_MOUSEMOVE,
WA_SimpleRefresh, TRUE,
WA_Flags, WFLG_DRAGBAR | WFLG_DEPTHGADGET | WFLG_CLOSEGADGET |
WFLG_NOCAREREFRESH,
WA_PubScreen, Screen,
WA_Width, Screen->WBorLeft + Screen->WBorRight +
(IMAGE_WIDTH+IMAGE_WIDTH),
WA_Height, Screen->WBorTop + Screen->Font->ta_YSize + 1 +
Screen->WBorBottom +
(IMAGE_HEIGHT+IMAGE_HEIGHT+IMAGE_HEIGHT+IMAGE_HEIGHT+AIMAGE),
WA_Left, 0, // left edge of screen
WA_Top, TSMorphWnd->TopEdge + Rect[GD_Help].MaxY + 2,
WA_ScreenTitle, CWTitle, // Top edge means help gadget is still visible
WA_Title, MyGetMsg(MSG_MOV), // This is wrong - could be a different mode ?
WA_MenuHelp, TRUE,
WA_NewLookMenus, TRUE,
TAG_DONE)) {
if (IntuitionBase->LibNode.lib_Version > 38) { // If running 3.0+ turn on gadget help
HelpControl(ControlWindow,HC_GADGETHELP);
}
UpdateMenuDefs(); // Update the menu off/on/checks etc.
/* Create,layout and add the menu */
if (MyMenu = CreateMenus(MyNewMenu,
GTMN_FullMenu,TRUE,
TAG_END)) {
if (VisInfo = GetVisualInfo(Screen, TAG_END)) {
if (LayoutMenus(MyMenu,VisInfo,
GTMN_NewLookMenus,TRUE,
TAG_END)) {
if (SetMenuStrip(ControlWindow,MyMenu)) {
// display either full or short help
if (GHelp) {
help(HNum);
}
else {
ihelp(HNum);
}
MySetMode(Mode);
return ControlWindow; /* Success !!! */
}
}
}
}
}
}
/* Something failed so clear everything down */
CloseControlWindow();
return NULL;
}
/* Close the Control Window
* or at least as much as it is open
* Clearing down all variables
*/
void
CloseControlWindow(void) {
if (ControlWindow) {
ClearMenuStrip(ControlWindow);
}
if (VisInfo) {
FreeVisualInfo(VisInfo);
VisInfo = NULL;
}
if (MyMenu) {
FreeMenus(MyMenu);
MyMenu = NULL;
}
if (ControlWindow) {
CloseWindow(ControlWindow);
ControlWindow = NULL;
}
if (Screen) {
UnlockPubScreen(NULL,Screen);
Screen = NULL;
}
}
/* Update the new menu array based on the current settings
* updates enabled/disabled status
* and checkmarks
*/
void
UpdateMenuDefs(void) {
if ((SinglePicture == 2) || (SinglePicture == 3)) { // No frame controls if not anim
MyNewMenu[NM_FRAME].nm_Flags &= ~NM_ITEMDISABLED;
}
else {
MyNewMenu[NM_FRAME].nm_Flags |= NM_ITEMDISABLED;
}
if (CreateIcons) { /* Supplied in CREATEICONS= */
MyNewMenu[NM_CREATEICONS].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_CREATEICONS].nm_Flags &= ~CHECKED;
}
if (CreateIconsP) { /* Supplied in CREATEICONSP= */
MyNewMenu[NM_ICONSP].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_ICONSP].nm_Flags &= ~CHECKED;
}
if (KeepSettings) { /* Supplied in KEEPSETTINGS= */
MyNewMenu[NM_KEEPS].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_KEEPS].nm_Flags &= ~CHECKED;
}
if (PaletteAllowed) { /* Supplied in CHANGEPALETTE= */
MyNewMenu[NM_CHANGEPALETTE].nm_Flags &= ~NM_ITEMDISABLED;
}
else {
MyNewMenu[NM_CHANGEPALETTE].nm_Flags |= NM_ITEMDISABLED;
}
if (palette) { /* Supplied in CHANGEPALETTE= */
MyNewMenu[NM_CHANGEPALETTE].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_CHANGEPALETTE].nm_Flags &= ~CHECKED;
}
if (ZoomAllowed) { /* Supplied in ZOOM= */
MyNewMenu[NM_ZOOM].nm_Flags &= ~NM_ITEMDISABLED;
}
else {
MyNewMenu[NM_ZOOM].nm_Flags |= NM_ITEMDISABLED;
}
if (Zoom) { /* Supplied in ZOOM= */
MyNewMenu[NM_ZOOM].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_ZOOM].nm_Flags &= ~CHECKED;
}
if (AntiAlias) { /* Supplied in ANTIALIAS= */
MyNewMenu[NM_ANTIALIAS].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_ANTIALIAS].nm_Flags &= ~CHECKED;
}
if (Integer) { /* Supplied in INTEGER= */
MyNewMenu[NM_INTEGER].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_INTEGER].nm_Flags &= ~CHECKED;
}
if (!ReqToolsBase) { // No reqtools.library so disable all string and int requesters
MyNewMenu[NM_SCREEN].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_DX].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_DY].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_LOADSCRIPT].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_PRESCRIPT].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_POSTSCRIPT].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_DEPTH].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_QUALITY].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_SCREENR].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_PPREVIEW].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_SPREVIEW].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_CUSTOM].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_CDEPTH].nm_Flags |= NM_ITEMDISABLED;
TSMorphNewMenu[12].nm_Flags |= NM_ITEMDISABLED;
}
if (!OpalBase) { // No opal.library so disable opal output formats and input mode
MyNewMenu[NM_OPAL24].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_OPAL24T].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_OPAL24F].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_OPAL24FT].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_OPALJPEG].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_OPALJPEGT].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_QUALITY].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_ILBMOPAL].nm_Flags |= NM_ITEMDISABLED;
}
if (!DCTVBase) { // no dctv.library so disable dctv output formats
MyNewMenu[NM_DCTV3].nm_Flags |= NM_ITEMDISABLED;
MyNewMenu[NM_DCTV4].nm_Flags |= NM_ITEMDISABLED;
}
if (CreateIconsR) { /* Supplied in CREATEICONSR= */
MyNewMenu[NM_ICONSR].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_ICONSR].nm_Flags &= ~CHECKED;
}
if (GHelp) { /* Supplied in HELP= */
MyNewMenu[NM_HELP].nm_Flags |= CHECKED;
}
else {
MyNewMenu[NM_HELP].nm_Flags &= ~CHECKED;
}
if (!handle) { // Have not managed to open amigaguide help file
MyNewMenu[NM_HELP].nm_Flags |= NM_ITEMDISABLED;
}
// Switch off all modes except current
MyNewMenu[NM_MODE1].nm_Flags &= ~CHECKED;
MyNewMenu[NM_MODE2].nm_Flags &= ~CHECKED;
MyNewMenu[NM_MODE4].nm_Flags &= ~CHECKED;
MyNewMenu[NM_MODE8].nm_Flags &= ~CHECKED;
MyNewMenu[NM_MODE16].nm_Flags &= ~CHECKED;
if (RenderMode & 1) {
MyNewMenu[NM_MODE1].nm_Flags |= CHECKED;
}
if (RenderMode & 2) {
MyNewMenu[NM_MODE2].nm_Flags |= CHECKED;
}
if (RenderMode & 4) {
MyNewMenu[NM_MODE4].nm_Flags |= CHECKED;
}
if (RenderMode & 8) {
MyNewMenu[NM_MODE8].nm_Flags |= CHECKED;
}
if (RenderMode & 16) {
MyNewMenu[NM_MODE16].nm_Flags |= CHECKED;
}
// switch off all output formats except current
MyNewMenu[NM_ILBM24].nm_Flags &= ~CHECKED;
MyNewMenu[NM_OPAL24].nm_Flags &= ~CHECKED;
MyNewMenu[NM_OPAL24T].nm_Flags &= ~CHECKED;
MyNewMenu[NM_OPAL24F].nm_Flags &= ~CHECKED;
MyNewMenu[NM_OPAL24FT].nm_Flags &= ~CHECKED;
MyNewMenu[NM_OPALJPEG].nm_Flags &= ~CHECKED;
MyNewMenu[NM_OPALJPEGT].nm_Flags &= ~CHECKED;
MyNewMenu[NM_PBM].nm_Flags &= ~CHECKED;
MyNewMenu[NM_BW16].nm_Flags &= ~CHECKED;
MyNewMenu[NM_BW256].nm_Flags &= ~CHECKED;
MyNewMenu[NM_HAM6].nm_Flags &= ~CHECKED;
MyNewMenu[NM_HAM8].nm_Flags &= ~CHECKED;
MyNewMenu[NM_DCTV3].nm_Flags &= ~CHECKED;
MyNewMenu[NM_DCTV4].nm_Flags &= ~CHECKED;
MyNewMenu[NM_ILBM24+SaveFormat].nm_Flags |= CHECKED;
// switch off all input modes except current
MyNewMenu[NM_ILBMALWAYS].nm_Flags &= ~CHECKED;
MyNewMenu[NM_ILBMIFILBM].nm_Flags &= ~CHECKED;
MyNewMenu[NM_ILBMIFCOLOURS].nm_Flags &= ~CHECKED;
MyNewMenu[NM_ILBMOPAL].nm_Flags &= ~CHECKED;
MyNewMenu[NM_ILBMALWAYS+OpenMode].nm_Flags |= CHECKED;
}